package com.xingxue.logistics.service;

import com.github.pagehelper.PageInfo;
import com.xingxue.logistics.common.vo.Page;
import com.xingxue.logistics.common.vo.RestResult;
import com.xingxue.logistics.common.vo.TreeNode;
import com.xingxue.logistics.dao.domain.SysMenu;
import com.xingxue.logistics.dao.domain.SysRole;

import java.util.List;

/**
 * @author Kris at 2018/10/9 10:06
 */
public interface MenuService {

    /**
     * 加载全部菜单
     * @return
     */
    List<SysMenu> loadAll();

    /**
     * 拼装为树形数据TreeNode
     * @param menuList
     * @return
     */
    List<TreeNode> createTree(List<SysMenu> menuList);

    /**
     * 分页查询菜单
     * @param id
     * @param parentId
     * @param menuName
     * @return
     */
    PageInfo<SysMenu> searchPage(Integer id, Integer parentId, String menuName, Integer pageNo, Integer pageSize);

    /**
     * 新增菜单
     * @param menu
     * @return
     */
    RestResult add(SysMenu menu);

    RestResult update(SysMenu menu);

    RestResult delete(Integer id);

    List<SysMenu> loadMenuByRoleId(Integer roleId);

    void updateMenuByRoleId(Integer roleId, Integer[] idsArr);
}
